﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using ZLCMS.Business.Util;

namespace ZLCMS.Web.Wap.Code
{
    public class AgentPageBase : Page
    {
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            if (string.IsNullOrEmpty(UserCode))
            {
                Response.Redirect("/wap/agent/Login.aspx?from=" + Server.UrlEncode(Request.RawUrl));
            }

            AgentAccount = string.IsNullOrEmpty(Request["agent"]) ? UserCode : Request["agent"];
        }

        protected string UserCode
        {
            get
            {
                //return "GD001";
                return UserKit.GetUserAccountWithoutException();
            }
        }


        protected string AgentAccount { get; set; }
    }
}